home *** CD-ROM | disk | FTP | other *** search
- /**************************************
- /* 回れ回れ for こB! by v914AKSTN *
- /**************************************
-
-
- /********************
- /* 起動時の初期設定 *
- /********************
- dim char map(24*24)
- dim int vec(3)={ -24, 1, 24, -1 }
- dim str arrow(4)={ "↑", "→", "↓", "←", "×" }
- int i,j
- int sc,x,m,r,l
- int flag=1
-
-
- /******************************
- /* ウィンドウオープン!!!! *
- /******************************
- WindowTitleOpen( 0, WINX, WINY, 384,384, 0, "回れ回れ for こB!", 2 )
- WindowTitleOpen( 1, WINX+390, WINY, 128,60, 0, "回れ回れ", 3 )
- end
- /******************
- /* 初期設定終わり *
- /******************
-
-
-
- /******************************************
- /* 再描画する必要が生じた時、呼び出される *
- /******************************************
- func Eredraw(wno)
- int i,j,a
- str s
-
- DrawClear( wno, 1 ) /* ウィンドウを灰色でクリア
- switch wno
- case 0:
-
- if flag then {
- if flag=1 then { /* ゲーム初期化処理
- sc=0:x=12+12*24:m=0:l=1
- } else { /* next level !
- x=12+12*24:m=0:l=l+1
- }
- flag=0
- for i=0 to 24*24-1
- map(i)=1 /* ドット
- next
- for i=0 to 23
- map(i )=2 /* 壁
- map(i+23*24)=2
- map( i*24)=2
- map(23+i*24)=2
- next
- for i=1 to 12*l /* 壁を散らす
- repeat
- j=int(rnd()*(24*24))
- until map(j)=1
- map(j)=2
- next
- r=22*22-16*l-6
- ITIME=30
- }
-
- a=0
- for i=0 to 23:s=""
- for j=0 to 23
- switch map(a)
- case 0:
- s=s+" "
- break
- case 1:
- s=s+"・"
- break
- case 2:
- s=s+"■"
- break
- endswitch
- a=a+1
- next
- DrawSymbol( 0, 0, i*16, s, 9, 16 )
- next
- break
- case 1:
- DrawSymbol( 1, 16, 8, "score : "+str$(sc), 9, 16 )
- DrawSymbol( 1, 16, 32, "level : "+str$(l), 9, 16 )
- endswitch
- endfunc
-
-
-
- /******************************
- /* 何か押されたら呼び出される *
- /******************************
- func Ekey(wno)
- switch info_KeyCode
- case 13:
- if ITIME=-1 then {
- flag=1 /* ゲーム初期化
- WindowRedraw( 0 )
- WindowRedraw( 1 )
- }
- break
- case 32:
- m=(m+1)and 3 /* 右に曲げる
- endswitch
- endfunc
-
-
-
- /**********************************
- /* ITIME/100 秒ごとに呼び出される *
- /**********************************
- func Einterval(wno)
- map(x)=0
- DrawSymbol( 0, (x mod 24)*16, (x\24)*16, " ", 9, 16 )
- x=x+vec(m)
- switch map(x)
- case 0:
- ITIME=8
- break
- case 1:
- ITIME=12
- sc=sc+1
- DrawSymbol( 1, 16, 8, "score : "+str$(sc), 9, 16 )
- r=r-1
- if r=0 then {
- repeat
- j=int(rnd()*(24*24))
- until map(j)=0
- map(j)=3
- DrawSymbol( 0, (j mod 24)*16, (j\24)*16, "C", 9, 16 )
- }
- break
- case 2:
- ITIME=-1
- m=4
- break
- case 3:
- flag=2 /* level up!
- WindowRedraw( 0 )
- WindowRedraw( 1 )
- return(1)
- endswitch
- DrawSymbol( 0, (x mod 24)*16, (x\24)*16, arrow(m), 9, 16 )
- endfunc
-
- /*******************************
- /* プログラム終わり H7/11/13 *
- /*******************************
-